---
title: "identity_not_found"
description: "The requested identity was not found"
---

<Danger>
err:unkey:data:identity_not_found
</Danger>


```json Example
{
  "meta": {
    "requestId": "req_2c9a0jf23l4k567"
  },
  "error": {
    "detail": "The requested identity could not be found",
    "status": 404,
    "title": "Not Found",
    "type": "https://unkey.com/docs/api-reference/errors-v2/unkey/data/identity_not_found"
  }
}
```

## What Happened?

This error occurs when you're trying to perform an operation on an identity that doesn't exist in the Unkey system. Identities in Unkey are used to represent users or entities that own or use API keys.

Common scenarios that trigger this error:
- Using an incorrect identity ID or external ID
- Referencing an identity that has been deleted
- Trying to update or get information about a non-existent identity
- Typos in identity identifiers

Here's an example of a request that would trigger this error:

```bash
# Attempting to get a non-existent identity
curl -X POST https://api.unkey.com/v2/identities.getIdentity \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer unkey_YOUR_API_KEY" \
  -d '{
    "identityId": "ident_nonexistent"
  }'
```

## How To Fix

Verify that you're using the correct identity ID or external ID and that the identity still exists in your workspace:

1. Check the identity ID in your request for typos or formatting errors
2. List all identities in your workspace to find the correct ID
3. If the identity has been deleted, you may need to recreate it



If you need to create a new identity, use the `identities.createIdentity` endpoint:

```bash
curl -X POST https://api.unkey.com/v2/identities.createIdentity \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer unkey_YOUR_API_KEY" \
  -d '{
    "externalId": "user_123",
    "meta": {
      "name": "John Doe",
      "email": "john@example.com"
    }
  }'
```

## Common Mistakes

- **Incorrect identifiers**: Using wrong identity IDs or external IDs
- **Deleted identities**: Attempting to reference identities that have been removed
- **Case sensitivity**: External IDs might be case-sensitive
- **Workspace boundaries**: Trying to access identities from another workspace

## Related Errors
- [err:unkey:data:identity_already_exists](./identity_already_exists) - When trying to create an identity that already exists
- [err:unkey:data:key_not_found](./key_not_found) - When the requested key doesn't exist
- [err:unkey:authorization:insufficient_permissions](../authorization/insufficient_permissions) - When you don't have permission to perform operations on identities
